package com.sponsorpay.sdk.android.publisher.currency;

import com.sponsorpay.sdk.android.publisher.AbstractResponse.RequestErrorType;
import org.json.JSONObject;

public class CurrencyServerDeltaOfCoinsResponse extends CurrencyServerAbstractResponse
{
  private static final String DELTA_OF_COINS_KEY = "delta_of_coins";
  private static final String LATEST_TRANSACTION_ID_KEY = "latest_transaction_id";
  private double mDeltaOfCoins;
  private String mLatestTransactionId;
  private VirtualCurrencyConnector mVirtualCurrencyConnector;

  public CurrencyServerDeltaOfCoinsResponse(VirtualCurrencyConnector paramVirtualCurrencyConnector)
  {
    this.mVirtualCurrencyConnector = paramVirtualCurrencyConnector;
  }

  public double getDeltaOfCoins()
  {
    return this.mDeltaOfCoins;
  }

  public String getLatestTransactionId()
  {
    return this.mLatestTransactionId;
  }

  public void onSuccessfulResponseParsed()
  {
    this.mVirtualCurrencyConnector.onDeltaOfCoinsResponse(this);
    if (this.mListener != null)
      this.mListener.onSPCurrencyDeltaReceived(this);
  }

  public void parseSuccessfulResponse()
  {
    try
    {
      JSONObject localJSONObject = new JSONObject(this.mResponseBody);
      this.mDeltaOfCoins = localJSONObject.getDouble("delta_of_coins");
      this.mLatestTransactionId = localJSONObject.getString("latest_transaction_id");
      this.mErrorType = AbstractResponse.RequestErrorType.NO_ERROR;
      return;
    }
    catch (Exception localException)
    {
      this.mErrorType = AbstractResponse.RequestErrorType.ERROR_INVALID_RESPONSE;
    }
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.sponsorpay.sdk.android.publisher.currency.CurrencyServerDeltaOfCoinsResponse
 * JD-Core Version:    0.6.2
 */